//
//  GameAventureViewController.h
//  ToucheTouche
//
//  Created by Jordan Montel on 10/01/12.
//  Copyright 2012 __MyCompanyName__. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "PauseViewController.h"
#import "EndGameViewController.h"
#import "Extra1ViewController.h"
#import "Extra2ViewController.h"
#import "Extra3ViewController.h"
#import "Extra4ViewController.h"
#import "Extra5ViewController.h"
#import <QuartzCore/QuartzCore.h>

@interface GameAventureViewController : UIViewController <UIAlertViewDelegate, PauseViewControllerDelegate, EndGameViewControllerDelegate, Extra1ViewControllerDelegate, Extra2ViewControllerDelegate, Extra3ViewControllerDelegate, Extra4ViewControllerDelegate, Extra5ViewControllerDelegate> {

    // Bouton pause
    UIButton *buttonPause;
    
    // Boutons associes aux images
    UIButton *button11;
    UIButton *button12;
    UIButton *button13;
    UIButton *button14;
    UIButton *button15;
    UIButton *button16;
    UIButton *button17;
    UIButton *button18;
    UIButton *button21;
    UIButton *button22;
    UIButton *button23;
    UIButton *button24;
    UIButton *button25;
    UIButton *button26;
    UIButton *button27;
    UIButton *button28;
    UIButton *button31;
    UIButton *button32;
    UIButton *button33;
    UIButton *button34;
    UIButton *button35;
    UIButton *button36;
    UIButton *button37;
    UIButton *button38;
    UIButton *button41;
    UIButton *button42;
    UIButton *button43;
    UIButton *button44;
    UIButton *button45;
    UIButton *button46;
    UIButton *button47;
    UIButton *button48;
    
    IBOutletCollection(UIButton) NSArray *allButtons;
    
    // Images associees aux boutons
    UIImageView *imageView11;
    UIImageView *imageView12;
    UIImageView *imageView13;
    UIImageView *imageView14;
    UIImageView *imageView15;
    UIImageView *imageView16;
    UIImageView *imageView17;
    UIImageView *imageView18;
    UIImageView *imageView21;
    UIImageView *imageView22;
    UIImageView *imageView23;
    UIImageView *imageView24;
    UIImageView *imageView25;
    UIImageView *imageView26;
    UIImageView *imageView27;
    UIImageView *imageView28;
    UIImageView *imageView31;
    UIImageView *imageView32;
    UIImageView *imageView33;
    UIImageView *imageView34;
    UIImageView *imageView35;
    UIImageView *imageView36;
    UIImageView *imageView37;
    UIImageView *imageView38;
    UIImageView *imageView41;
    UIImageView *imageView42;
    UIImageView *imageView43;
    UIImageView *imageView44;
    UIImageView *imageView45;
    UIImageView *imageView46;
    UIImageView *imageView47;
    UIImageView *imageView48;

    IBOutletCollection(UIImageView) NSArray *allImagesView;

    /* Vues */
    PauseViewController *pauseViewController; // vue pause
    EndGameViewController *endGameViewController; // vue fin de partie
    Extra1ViewController *extra1ViewController; // vue extra 1
    Extra2ViewController *extra2ViewController; // vue extra 2
    Extra3ViewController *extra3ViewController; // vue extra 3
    Extra4ViewController *extra4ViewController; // vue extra 4
    Extra5ViewController *extra5ViewController; // vue extra 5
    
    /* AlertView */
    UIAlertView *alertViewExtraLevel;
    UIAlertView *alertViewNewLevel;
    
    /* Timers */ 
    NSTimer *timerMouvement; // timer affichage image
    NSTimer *timerLevel; // timer temps du niveau
    
    /* Float */
    float floatScoreToAddByLevel; // score de l'extra a ajouter au score general
    float floatScoreLastLevel; // score du niveau
    
    /* NSInteger */
    NSInteger intRandom; // random position image
    NSInteger intLastRandom; // sauvegarde dernier random position image
    NSInteger intLastLevel; // sauvegarde du numero du niveau

    /* Bool */
    bool boolEndGame;
    bool boolImageNotTouched;
    
    /* NSString */
    NSString *fileNameImage;
    
    
}

@property (nonatomic, retain) NSString *fileNameImage;


@property (nonatomic, retain) UIAlertView *alertViewExtraLevel;
@property (nonatomic, retain) UIAlertView *alertViewNewLevel;

@property (nonatomic, assign) bool boolEndGame;

@property (nonatomic, retain) IBOutlet UIProgressView *progressViewLife;

@property (nonatomic, assign) float floatScoreToAddByLevel;
@property (nonatomic, assign) float floatScoreLastLevel;

@property (nonatomic, assign) NSInteger intRandom;
@property (nonatomic, assign) NSInteger intLastRandom;
@property (nonatomic, assign) NSInteger intLastLevel;

@property (nonatomic,retain) IBOutlet UIButton *buttonPause;

@property (nonatomic,retain) IBOutlet UIButton *button11;
@property (nonatomic,retain) IBOutlet UIButton *button12;
@property (nonatomic,retain) IBOutlet UIButton *button13;
@property (nonatomic,retain) IBOutlet UIButton *button14;
@property (nonatomic,retain) IBOutlet UIButton *button15;
@property (nonatomic,retain) IBOutlet UIButton *button16;
@property (nonatomic,retain) IBOutlet UIButton *button17;
@property (nonatomic,retain) IBOutlet UIButton *button18;
@property (nonatomic,retain) IBOutlet UIButton *button21;
@property (nonatomic,retain) IBOutlet UIButton *button22;
@property (nonatomic,retain) IBOutlet UIButton *button23;
@property (nonatomic,retain) IBOutlet UIButton *button24;
@property (nonatomic,retain) IBOutlet UIButton *button25;
@property (nonatomic,retain) IBOutlet UIButton *button26;
@property (nonatomic,retain) IBOutlet UIButton *button27;
@property (nonatomic,retain) IBOutlet UIButton *button28;
@property (nonatomic,retain) IBOutlet UIButton *button31;
@property (nonatomic,retain) IBOutlet UIButton *button32;
@property (nonatomic,retain) IBOutlet UIButton *button33;
@property (nonatomic,retain) IBOutlet UIButton *button34;
@property (nonatomic,retain) IBOutlet UIButton *button35;
@property (nonatomic,retain) IBOutlet UIButton *button36;
@property (nonatomic,retain) IBOutlet UIButton *button37;
@property (nonatomic,retain) IBOutlet UIButton *button38;
@property (nonatomic,retain) IBOutlet UIButton *button41;
@property (nonatomic,retain) IBOutlet UIButton *button42;
@property (nonatomic,retain) IBOutlet UIButton *button43;
@property (nonatomic,retain) IBOutlet UIButton *button44;
@property (nonatomic,retain) IBOutlet UIButton *button45;
@property (nonatomic,retain) IBOutlet UIButton *button46;
@property (nonatomic,retain) IBOutlet UIButton *button47;
@property (nonatomic,retain) IBOutlet UIButton *button48;

@property (nonatomic, retain) IBOutletCollection(UIButton) NSArray *allButtons;

@property (nonatomic,retain) IBOutlet UIImageView *imageView11;
@property (nonatomic,retain) IBOutlet UIImageView *imageView12;
@property (nonatomic,retain) IBOutlet UIImageView *imageView13;
@property (nonatomic,retain) IBOutlet UIImageView *imageView14;
@property (nonatomic,retain) IBOutlet UIImageView *imageView15;
@property (nonatomic,retain) IBOutlet UIImageView *imageView16;
@property (nonatomic,retain) IBOutlet UIImageView *imageView17;
@property (nonatomic,retain) IBOutlet UIImageView *imageView18;
@property (nonatomic,retain) IBOutlet UIImageView *imageView21;
@property (nonatomic,retain) IBOutlet UIImageView *imageView22;
@property (nonatomic,retain) IBOutlet UIImageView *imageView23;
@property (nonatomic,retain) IBOutlet UIImageView *imageView24;
@property (nonatomic,retain) IBOutlet UIImageView *imageView25;
@property (nonatomic,retain) IBOutlet UIImageView *imageView26;
@property (nonatomic,retain) IBOutlet UIImageView *imageView27;
@property (nonatomic,retain) IBOutlet UIImageView *imageView28;
@property (nonatomic,retain) IBOutlet UIImageView *imageView31;
@property (nonatomic,retain) IBOutlet UIImageView *imageView32;
@property (nonatomic,retain) IBOutlet UIImageView *imageView33;
@property (nonatomic,retain) IBOutlet UIImageView *imageView34;
@property (nonatomic,retain) IBOutlet UIImageView *imageView35;
@property (nonatomic,retain) IBOutlet UIImageView *imageView36;
@property (nonatomic,retain) IBOutlet UIImageView *imageView37;
@property (nonatomic,retain) IBOutlet UIImageView *imageView38;
@property (nonatomic,retain) IBOutlet UIImageView *imageView41;
@property (nonatomic,retain) IBOutlet UIImageView *imageView42;
@property (nonatomic,retain) IBOutlet UIImageView *imageView43;
@property (nonatomic,retain) IBOutlet UIImageView *imageView44;
@property (nonatomic,retain) IBOutlet UIImageView *imageView45;
@property (nonatomic,retain) IBOutlet UIImageView *imageView46;
@property (nonatomic,retain) IBOutlet UIImageView *imageView47;
@property (nonatomic,retain) IBOutlet UIImageView *imageView48;

@property (nonatomic, retain) IBOutletCollection(UIImageView) NSArray *allImagesView;

@property (retain, nonatomic) IBOutlet UILabel *labelScore;
@property (retain, nonatomic) IBOutlet UILabel *labelTime;
@property (nonatomic, retain) IBOutlet UILabel *labelLife;
@property (retain, nonatomic) IBOutlet UILabel *labelLevel;

- (IBAction)pushPause;
- (IBAction)actionImage:(id)sender;

- (void)randomPositionImage;
- (void)timerImage;
- (void)timerLevel:(NSInteger)intTimeLvl;
- (void)addScore:(id)sender;
- (void)addScoreNextExtra;
- (void)removeLife:(id)sender;
- (void)restartGame;
- (void)endGame;
- (void)stopTimer;
- (void)stopTimerLevel;
- (void)currentLevel;
- (void)pushExtraView;
- (void)timerLevelBackToGame;
- (void)imageNotTouched;
- (void)initLabel;

@end
